/**
	Pulsar engine. Additional include file.
	Default preprocessor checks.

	Copyright (C) 2013-2014 Dmitry Dolgov

	This program is free software; you can redistribute it and/or modify it under the terms of the
	GNU General Public License as published by the Free Software Foundation; either version 2 of
	the License, or (at your option) any later version.
		
	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
	without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	See the GNU General Public License for more details.
*/

#ifndef _PL_DEFCHECK_H_
#define _PL_DEFCHECK_H_

/**
	Entry point (main()/WinMain())
	PL_ENTRY_POINT_INTERNAL - use entry point inside pulsar
	PL_ENTRY_POINT_EXTERNAL - use entry point outside pulsar, user must initialize library
*/
#if !defined(PL_ENTRY_POINT_INTERNAL) && !defined(PL_ENTRY_POINT_EXTERNAL)
#error "No entry point specified"
#endif

#if defined(PL_ENTRY_POINT_INTERNAL) + defined(PL_ENTRY_POINT_EXTERNAL) != defined(_PL_DEFCHECK_H_)
#error "More than one entry point specified"
#endif

/**
	PL_DEBUG - debug configuration
	PL_RELEASE - release version with asserts and debug info
	PL_FINAL - release version
*/
#if !defined(PL_DEBUG) && !defined(PL_RELEASE) && !defined(PL_FINAL)
#error "No build configuration specified"
#endif

#if defined(PL_DEBUG) + defined(PL_RELEASE) + defined(PL_FINAL) != defined(_PL_DEFCHECK_H_)
#error "More than one build configuration specified"
#endif

/**
	Operation System
	PL_WINDOWS - Windows 32 bit
	PL_WINDOWS64 - Windows 64 bit 
	PL_LINUX - Linux
	PL_LINUX64
	PL_DOS - (in addition to PL_WINDOWS/PL_WINDOWS64) - console application
	PL_DLL - (in addition to PL_WINDOWS/PL_WINDOWS64) - DLL application
*/
#if !defined(PL_WINDOWS) && !defined(PL_WINDOWS64) && !defined(PL_LINUX) && !defined(PL_LINUX64)
#error "No Operation System specified"
#elif defined(PL_WINDOWS) + defined(PL_WINDOWS64) + defined(PL_LINUX) + defined(PL_LINUX64) != defined(_PL_DEFCHECK_H_)
#error "More than one Operation System specified"
#endif

#if defined(PL_DOS) && !defined(PL_WINDOWS) && !defined(PL_WINDOWS64)
#error "PL_DOS specifications can't be used without PL_WINDOWS or PL_WINDOWS64"
#endif

#if defined(PL_DLL) && !defined(PL_WINDOWS) && !defined(PL_WINDOWS64)
#error "PL_DLL specifications can't be used without PL_WINDOWS or PL_WINDOWS64"
#endif

#if defined(PL_DLL) + defined(PL_DOS) > (defined(PL_WINDOWS) || defined(PL_WINDOWS64))
#error "PL_DLL / PL_DOS can't be used simultaneously"
#endif 

/**
	Compiler
	PL_MSC - Microsoft Visual Studio
	PL_IC - Intel Compiler
	PL_GCC - GNU C++
*/
#if !defined(PL_MSC) && !defined(PL_IC) && !defined(PL_GCC)
#error "No compiler type specified"
#elif defined(PL_MSC) + defined(PL_IC) + defined(PL_GCC) != defined(_PL_DEFCHECK_H_)
#error "More than one compiler type specified"
#endif

/**
	CPU type
	PL_INTEL - x86
	PL_INTEL64 - x64
*/
#if !defined(PL_INTEL) && !defined(PL_INTEL64)
#error "No CPU type specified"
#elif defined(PL_INTEL) + defined(PL_INTEL64) != defined(_PL_DEFCHECK_H_)
#error "More than one CPU type specified"
#endif

/**
	Math optimization (by default)
*/
#define PL_MATH_DEFAULT

/**
	Character set
	PL_ANSI - multybyte charset 
	PL_UNICODE - unicode 16 bit charset
	PL_UNICODE32 - unicode 32 bit charset
*/
#if !defined(PL_ANSI) && !defined(PL_UNICODE) && !defined(PL_UNICODE32)
#error "No String type specified"
#elif defined(PL_ANSI) + defined(PL_UNICODE) + defined(PL_UNICODE32) != defined(_PL_DEFCHECK_H_)
#error "More than one String type specified"
#endif

/**
	Memory management
	PL_MEMORY_DEBUG - full debug memory managent
	PL_MEMORY_RELEASE - release memory managent with some checks
	PL_MEMORY_FINAL - final memory managent
	PL_MEMORY_NONE - all memory features turned off
*/
#if !defined(PL_MEMORY_DEBUG) && !defined(PL_MEMORY_RELEASE) && !defined(PL_MEMORY_FINAL) && !defined(PL_MEMORY_NONE)
#error "No memory management type defined"
#endif

#if defined(PL_MEMORY_DEBUG) + defined(PL_MEMORY_RELEASE) + defined(PL_MEMORY_FINAL) + defined(PL_MEMORY_NONE) != defined(_PL_DEFCHECK_H_)
#error "More than one debug memory management type specified"
#endif

/**
	Byte ordering
	PL_BYTE_LE - little endian
	PL_BYTE_BE - big endian
*/
#if !defined(PL_BYTE_LE) && !defined(PL_BYTE_BE)
#error "Wrong CPU code"
#endif

#if defined(PL_BYTE_LE) + defined(PL_BYTE_BE) != defined(_PL_DEFCHECK_H_)
#error "More than one byte ordering specified"
#endif

/**
	Protocol support
	PL_LOG_DEBUG - all logs
	PL_LOG_INFO - plLogInfo() and above
	PL_LOG_WARN - plLogWarn() and above
	PL_LOG_ERROR - plLogError() and ebove
	PL_LOG_FATAL - plLogFatal() only
*/
#if !defined(PL_LOG_DEBUG) && !defined(PL_LOG_INFO) && !defined(PL_LOG_WARN) && !defined(PL_LOG_ERROR) && !defined(PL_LOG_FATAL)
#error "No log type specified"
#endif

#if defined(PL_LOG_DEBUG) + defined(PL_LOG_INFO) + defined(PL_LOG_WARN) + defined(PL_LOG_ERROR) + defined(PL_LOG_FATAL) != defined(_PL_DEFCHECK_H_)
#error "More than one log type specified"
#endif

#endif // _PL_DEFCHECK_H_

//
// End of file 'pulsar_defcheck.h'
//
